package io.renren.modules.medical.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.medical.validator.EnumValue;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 
 * 
 * @author luosheng
 * @email luoshengshuai@foxmail.com
 * @date 2023-05-09 12:44:53
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("patient_basic_information")
public class PatientBasicInformationEntity extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 病人id
	 */
	@TableField("patient_info_id")
	@NotNull(message = "添加或修改时病人id不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long patientInfoId;
	/**
	 * 医生id
	 */
	@TableField("doctor_id")
	@Null(message = "添加或修改时医生id为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long doctorId;
	/**
	 * 病情类型
	 */
	@TableField("sub_id")
	@NotNull(message = "添加或修改时病情类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long subId;

	/**
	 * 病人是否添加的膝关节炎病情 0:不是，1:是
	 */
	@TableField("is_gonitis")
	private Integer isGonitis;

	/**
	 * 门诊号/住院号
	 */
	@NotNull(message = "添加或修改时门诊号不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long patientNumber;
	/**
	 * 病人姓名
	 */
	@Null(message = "修改时用户姓名为空", groups = {UpdateGroup.class})
	private String name;
	/**
	 * 1：男0：女
	 */
	@EnumValue(intValues = {0, 1}, message = "添加或修改时性别只能为指定值", groups = {AddGroup.class, UpdateGroup.class})
	private Integer sex;
	/**
	 * 民族
	 */
	@NotBlank(message = "修改或添加时民族不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String nation;
	/**
	 * 身份证号
	 */
	@NotBlank(message = "修改或添加时民族不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String idNumber;
	/**
	 * 1:已婚0未婚2:离异
	 */
	@EnumValue(intValues = {0, 1, 2}, message = "添加或修改时婚姻状态只能为指定值", groups = {AddGroup.class, UpdateGroup.class})
	private Integer marriage;
	/**
	 * 职业
	 */
	@NotBlank(message = "修改或添加时职业不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String profession;
	/**
	 * 身高
	 */
	@NotNull(message = "修改或添加时身高不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Float height;
	/**
	 * 体重
	 */
	@NotNull(message = "修改或添加时体重不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Float weight;
	/**
	 * 体质指数
	 */
	@NotNull(message = "修改或添加时体质指数不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Float patientBmi;
	/**
	 * 常见运动以及其运动频率
	 */
	private String exercise;
	/**
	 * 烟、酒、特殊药物摄入史
	 */
	private String ingestHistory;
	/**
	 * 发病节气
	 */
	@NotBlank(message = "修改或添加时发病节气不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String patientTerm;
	/**
	 * 病史可靠程度
	 */
	@NotNull(message = "修改或添加时病史可靠程度不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Integer patientHistoryReliable;
	/**
	 * 出生地
	 */
	@NotBlank(message = "修改或添加时出生地不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String birthAddress;
	/**
	 * 现居住地
	 */
	@NotBlank(message = "修改或添加时现居住地不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String presentAddress;
	/**
	 * 联系电话
	 */
	@NotBlank(message = "修改或添加时联系电话不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String phoneNumber;
	/**
	 * 紧急联系人电话
	 */
	@NotBlank(message = "修改或添加时紧急联系人电话不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String emergencyContactNumber;
	/**
	 * 就诊时间
	 */
	@NotNull(message = "修改或添加时就诊时间不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
	private Date clinicTime;
}
